#include "sort.h"

int partition(int *a, int low, int high){
    int piovt = a[low];
    while(low < high){
        while( a[high] > piovt && low < high ) --high;
        a[low] = a[high];
        while( a[low] < piovt && low < high ) ++low;
        a[high] = a[low];
    }
    a[low] = piovt;
    return low;
}

void quickSort(int a[], int low, int high){
    if(low < high){
        int mid = partition(a, low, high);

        quickSort(a, low, mid-1);
        quickSort(a, mid+1, high);
    }
}